<template>
  <div class="xzs">
    <div class="title">
      每日资讯
    </div>
    <div class="content"
         v-for="(item,index) in zixun"
         :key="index">
      <div class="biaoti">
        <span>{{ item.title }}</span>
      </div>
      <div class="neirong">
        <span>{{ item.content }}</span>
      </div>
    </div>
  </div>
</template>



<script>
import { onMounted, ref } from 'vue'
import axios from '@/axios'
export default {
  components: {},
  setup() {
    let zixun = ref('')
    onMounted(() => {
      //获取每日资讯
      axios
        .get('/zixun')
        .then((d) => {
          zixun.value = d
        })
        .catch((err) => console.log(err))
    })

    return {
      zixun
    }
  }
}
</script>

<style scoped lang="less">
.xzs {
  background: url(/imgs/list2.jpg) no-repeat;
  background-size: 100% 100%;
  width: 100%;
  height: 387px;
  padding: 30px;
  position: relative;
  .title {
    width: 600px;
    height: 60px;
    position: absolute;
    top: 30px;
    right: 60px;
    color: #d28936;
    font-size: 30px;
    text-align: center;
    padding: 20px 0;
  }
  .content {
    position: absolute;
    top: 100px;
    right: 60px;
    width: 600px;
    height: 275px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    // background-color: #d28936;
    border: 2px dashed #d28936;
    .biaoti {
      width: 100%;
      height: 40px;
      line-height: 40px;
      text-align: center;
      font-size: 24px;
      font-weight: 600;
      border-bottom: 2px dashed #d28936;
    }
    .neirong {
      // background-color: #eee;
      height: 235px;
      margin-top: 20px;
      padding: 20px;
      font-size: 20px;
      text-indent: 2rem;
    }
  }
}
</style>

